//
//  WPDIYSegment.h
//  WPDIYSegment
//
//  Created by WeiPan on 16/4/4.
//  Copyright © 2016年 HuaYiSoftware. All rights reserved.
//

#import <UIKit/UIKit.h>
@protocol WPDIYSegmentClickedDelegeate <NSObject>
- (void)WPDIYSegmentClicked:(NSInteger)currentIndex;
@end
@interface WPDIYSegment : UIView
@property (nonatomic, strong) UIColor * titleColor;
@property (nonatomic, strong) UIColor * titleSelectColor;
@property (nonatomic, strong) UIFont * titleFont;
@property (nonatomic, strong) UIColor * lineColor;        //移动线的颜色(默认黑色)
@property (nonatomic, assign) CGFloat    lineHeight;        //移动线的高度(默认2)
@property (nonatomic, assign) CGFloat    lineCornerRadius;  //移动线的两边弧度(默认3)
@property (nonatomic, copy  ) void(^indexBlock)(NSInteger index, NSString * title) ;        //block回调(返回标题、下标)
- (instancetype)initWithTitles:(NSArray * )titles andNormalColor:(UIColor *)color
              andSelectedColor:(UIColor *)selectedColor andFont:(UIFont *)font;
- (instancetype)initWithTitles:(NSArray * )titles andNormalColor:(UIColor *)color
              andSelectedColor:(UIColor *)selectedColor;
- (instancetype)initWithTitles:(NSArray * )titles andNormalColor:(UIColor *)color;
- (instancetype)initWithTitles:(NSArray * )titles;
- (void)setData:(NSArray *)titles NormalColor:(UIColor *)n_color SelectColor:(UIColor *)s_color Font:(UIFont *)font;
- (void)getCurrentIndexWithBlock:(void(^)(NSInteger index, NSString * title))indexBlock;
- (void)selectIndexWithIndex:(NSInteger)index;
- (WPDIYSegment *)setSegmentOriginPoint:(CGPoint)point;
@property (nonatomic, assign)id <WPDIYSegmentClickedDelegeate> delegate;
@end
